from frame_work.setting import *
from frame_work.yaml_file import YAML

yaml_data = YAML(os.path.join(base_Dir, 'data', 'data.yaml'))


def low_release(**kwargs):
    """
    初级活动发布活动数据
    :param kwargs:
    :return:
    """
    type = kwargs.get('trysType')
    url = yaml_data.get_data('low_release')['url']
    post_data = yaml_data.get_data('low_release')['data']
    header = yaml_data.get_data('low_release')['header']
    if type == 1:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        wd_pic = kwargs.get('wd_pic')
        post_data.update({'token': token})
        post_data.update({'img_wx': wd_pic})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 4:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'sk_question': 'qwe'})
        post_data.update({'sk_answer': 'qwe'})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 2:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'search_styles[1][keyword]': '按摩披肩'})
        post_data.update({'search_styles[1][orderby]': '销量'})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 6:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': ''})
    elif type == 7:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update(
            {'command': '【这个#聚划算团购#宝贝不错:金沙河挂面面条 银丝挂面900g*3包 细面条圆面条龙须面 包邮(分享自@手机淘宝android客户端)】https://m.tb.cn/h.e7VBaBW?sm=60194c 点击链接，再选择浏览器咑閞；或復·制这段描述￥WhySYSgYkTC￥后到淘♂寳♀'})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': ''})
    elif type == 13:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'search_styles[1][command]': '口令'})
        post_data.update({'search_styles[1][orderby]': '综合'})
    elif type == 15:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        qr_pic = kwargs.get('qr_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'search_styles[1][qr]': qr_pic})
        post_data.update({'search_styles[1][orderby]': '综合'})
    elif type == 8:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'search_styles[1][keyword]': '男装'})
        post_data.update({'search_styles[1][orderby]': '综合'})
    elif type == 10:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 11:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': ''})
    elif type == 14 and kwargs.get('order_type') == 1:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'search_styles[1][keyword]': '男装'})
        post_data.update({'search_styles[1][orderby]': '综合'})
    elif type == 14 and kwargs.get('order_type') == 2:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        order_type = kwargs.get('order_type')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'order_type': order_type})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'search_styles[1][command]': '关键词搜索淘口令'})
        post_data.update({'search_styles[1][orderby]': '综合'})
    elif type == 19:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        shop_ww_name = kwargs.get('shop_ww_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'wangwang': shop_ww_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': ''})
        post_data.update({'package[]': ['电脑', '键盘', '显示器', '显卡', '硬盘']})
        post_data.update(
            {'multimode[7]': '3幅治内容￥quaJciq5lE0$咑开ホ兆bao或掂击炼接 https://m.tb.cn/h.4bGwISf?sm=6f9781 至流览器【Mlekovita原装进口牛奶全脂1L*12 成人儿童孕妇早餐高钙家庭装】'})
    elif type == 5:  # 抢试用 不用了
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.pop('GrantNum')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
        post_data.update({'quantity_section[0][start_time]': '08:00'})
        post_data.update({'quantity_section[0][end_time]': '18:00'})
        post_data.update({'quantity_section[0][quantity]': '5'})
        post_data.update({'appGrantNum': '50'})
        post_data.update({'mobile_step1': '打开首页'})
        post_data.update({'mobile_step1_href': 'https://m.taobao.com'})
        post_data.update({'mobile_step2': '拖鞋'})
        post_data.update(
            {'mobile_step2_href': 'https://s.m.taobao.com/h5?q=%E6%8B%96%E9%9E%8B&search=%E6%8F%90%E4%BA%A4&tab=all'})
        post_data.update({'mobile_step3': url_order})
    elif type == 17:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        order_type = kwargs.get('order_type')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        source = kwargs.get('source')
        qr_pic = kwargs.get('qr_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'order_type': order_type})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'try_types[]': [8, 6]})
        # post_data.update({'try_types[]':[8,6]})
        post_data.pop('multimode[19]')
        post_data.pop('multimode[7]')
        post_data.update({'multimode[8][keyword]': '大码'})
        post_data.update({'multimode[8][orderby]': '销量'})
        post_data.update({'multimode[6]': 1})
        if source == '京东':
            post_data.update({'multimode[15][qr]': qr_pic})
            post_data.update({'multimode[15][orderby]': '综合'})
        elif source == '抖音':
            post_data.update(
                {'multimode[7]': '【这个#聚划算团购#宝贝不错:金沙河挂面面条 银丝挂面900g*3包 细面条圆面条龙须面 包邮(分享自@手机淘宝android客户端)】https://m.tb.cn/h.e7VBaBW?sm=60194c 点击链接，再选择浏览器咑閞；或復·制这段描述￥WhySYSgYkTC￥后到淘♂寳♀'})
        elif source in ('淘宝', '天猫'):
            post_data.update({'try_types[]': [15, 13, 7]})
            post_data.update({'multimode[15][qr]': qr_pic})
            post_data.update({'multimode[15][orderby]': '综合'})
            post_data.update({'multimode[13][command]': '关键词搜索淘口令'})
            post_data.update({'multimode[13][orderby]': '价格'})
            post_data.update(
                {'multimode[7]': '【这个#聚划算团购#宝贝不错:金沙河挂面面条 银丝挂面900g*3包 细面条圆面条龙须面 包邮(分享自@手机淘宝android客户端)】https://m.tb.cn/h.e7VBaBW?sm=60194c 点击链接，再选择浏览器咑閞；或復·制这段描述￥WhySYSgYkTC￥后到淘♂寳♀'})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 16:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        order_type = kwargs.get('order_type')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'order_type': order_type})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
    elif type == 9:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        # shopId = kwargs.get('shopId')
        # shop_name = kwargs.get('shop_name')
        title_pic = kwargs.get('title_pic')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        post_data = {
            'token': token,
            'tid': '',
            'trysType': trysType,
            # 'shopId':shopId,
            'DateNum': 23,
            'Title': Title,
            'cate_cid': 16,
            'img': title_pic,
            'GrantNum': 22,
            'exchangeNum': 0,
            'Price': 52,
            'url_order': url_order,
            'encode_url': url_order,
            'url_favorites': '',
            'Intro': 111111
        }
    elif type == 20:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        trySource = kwargs.get('trySource')
        bcid = kwargs.get('bcid')
        bid = kwargs.get('bid')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'trySource': trySource})
        post_data.update({'brand_cate_id': bcid})
        post_data.update({'brand_id': bid})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'sk_question': 'qwe'})
        post_data.update({'sk_answer': 'qwe'})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 21:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        order_type = kwargs.get('order_type')
        trySource = kwargs.get('trySource')
        shopId = kwargs.get('shopId')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        source = kwargs.get('source')
        pingou_img = kwargs.get('pingou_img')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'order_type': order_type})
        post_data.update({'trySource': trySource})
        post_data.update({'shopId': shopId})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'try_types[]': [8, 6]})
        # post_data.pop('multimode[19]')
        post_data.pop('multimode[7]')
        post_data.update({'multimode[8][keyword]': '大码'})
        post_data.update({'multimode[8][orderby]': '销量'})
        post_data.update({'multimode[6]': 1})
        post_data.update({'pingou_img': pingou_img})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    elif type == 22:
        token = kwargs.get('token')
        trysType = kwargs.get('trysType')
        order_type = kwargs.get('order_type')
        trySource = kwargs.get('trySource')
        shop_name = kwargs.get('shop_name')
        Title = kwargs.get('Title')
        url_order = kwargs.get('url_order')
        title_pic = kwargs.get('title_pic')
        result_pic = kwargs.get('result_pic')
        post_data.update({'token': token})
        post_data.update({'trysType': trysType})
        post_data.update({'order_type': order_type})
        post_data.update({'trySource': trySource})
        post_data.update({'shopname': shop_name})
        post_data.update({'Title': Title})
        post_data.update({'intro_on_app': Title})
        post_data.update({'try_types[]': [6, 7, 8]})
        post_data.pop('multimode[19]')
        post_data.pop('multimode[7]')
        post_data.update({'multimode[8][keyword]': '大码'})
        post_data.update({'multimode[8][orderby]': '销量'})
        post_data.update({'multimode[6]': 1})
        post_data.update(
            {'multimode[7]': '2.0f/u枝口~令₴gG8RclNcSIz£回Tá0宔或點̸击̸链节 https: //m.tb.cn/h.4WQqTu9?sm=7f5b2c 至liulanqi【女童爱莎公主裙秋装冰雪奇缘万圣节艾莎灰姑娘连衣裙长袖儿童裙子】'})
        post_data.update({'url_order': url_order})
        post_data.update({'encode_url': url_order})
        post_data.update({'img': title_pic})
        post_data.update({'pimg': result_pic})
    return url, post_data, header


def tfx_release(**kwargs):
    """
    淘发现发布活动数据
    :param kwargs:
    :return:
    """
    url = yaml_data.get_data('tfx_release')['url']
    post_data = yaml_data.get_data('tfx_release')['data']
    header = yaml_data.get_data('tfx_release')['header']
    source = kwargs.get('source')
    shopId = kwargs.get('shopId')
    shop_name = kwargs.get('shop_name')
    url_order = kwargs.get('url_order')
    Title = kwargs.get('Title')
    img_list = kwargs.get('img_list')
    section_radio = kwargs.get('section_radio')
    # search_pic = kwargs.get('search_pic')
    img_detail_pic = kwargs.get('search_pic')
    token = kwargs.get('token')
    post_data.update({'source': source})
    post_data.update({'shop_id': shopId})
    post_data.update({'shop_name': shop_name})
    post_data.update({'url_order': url_order})
    post_data.update({'coupon_url': url_order})
    post_data.update({'title': Title})
    post_data.update({'img_list': img_list})
    post_data.update({'section_radio': section_radio})
    post_data.update({'section[type]': section_radio})
    if str(section_radio) == '1':
        del post_data["section[date]"]
    if source == 1:
        post_data.update({"order_tips[]": ["order_tip_1_1",
                                           "order_tip_1_2",
                                           "order_tip_1_3",
                                           "order_tip_1_4",
                                           "order_tip_1_5"]})
    elif source == 2:
        post_data.update({"order_tips[]": ["order_tip_2_1",
                                           "order_tip_2_2",
                                           "order_tip_2_3",
                                           "order_tip_2_4",
                                           "order_tip_2_5"]})
    elif source == 3:
        post_data.update({"order_tips[]": ["order_tip_3_1",
                                           "order_tip_3_2",
                                           "order_tip_3_3",
                                           "order_tip_3_4",
                                           "order_tip_3_5"]})
        post_data.update({'order_type': 1003})
        post_data.update({'orders_type[1003][num]': 30})
        del post_data["orders_type[1002][num]"]
        del post_data["orders_type[1002][command]"]
    elif source == 4:
        post_data.update({"order_tips[]": ["order_tip_4_1",
                                           "order_tip_4_2",
                                           "order_tip_4_3",
                                           "order_tip_4_4",
                                           "order_tip_4_5"]})
        post_data.update({'order_type': 1003})
        post_data.update({'orders_type[1003][num]': 30})
        del post_data["orders_type[1002][num]"]
        del post_data["orders_type[1002][command]"]
        del post_data["pur_puls[2003][is_checked]"]
        del post_data["pur_puls[2003][num]"]
    post_data.update({'sk_title': Title})
    post_data.update({'img_detail': img_list})
    post_data.update({'orders_type[1001][img_search]': img_detail_pic})
    post_data.update({'token': token})
    return url, post_data, header


def high_quality_release(**kwargs):
    """
    精品试用发布活动数据
    :param kwargs:
    :return:
    """
    url = yaml_data.get_data('high_quality_release')['url']
    post_data = yaml_data.get_data('high_quality_release')['data']
    header = yaml_data.get_data('high_quality_release')['header']
    token = kwargs.get('token')
    enter_type = kwargs.get('enter_type')
    source = kwargs.get('source')
    shopId = kwargs.get('shopId')
    shop_name = kwargs.get('shop_name')
    Title = kwargs.get('Title')
    url_order = kwargs.get('url_order')
    title_pic = kwargs.get('title_pic')
    search_pic = kwargs.get('search_pic')
    qr_search_pic = kwargs.get('qr_search_pic')
    qr_order_pic = kwargs.get('qr_order_pic')
    # 根据每个进店方式的份数计算总份数，进店方式是根据用户自己选择的
    totle = sum([post_data.get("try_extend_enter[%s][total]" % type)
                for type in enter_type])
    post_data.update({'token': token})
    post_data.update({'try_extend[enter_type][]': enter_type})
    post_data.update({'trySource': source})
    post_data.update({'shop_id': shopId})
    post_data.update({'shop_name': shop_name})
    post_data.update({'url_order': url_order})
    post_data.update({'img_list': title_pic})
    post_data.update({'title': Title})
    post_data.update({'img_search': search_pic})
    post_data.update(
        {'try_extend_enter[16][search_styles][0][scan_img]': qr_search_pic})
    post_data.update({'try_extend_enter[8][scan_img]': qr_order_pic})
    post_data.update({'GrantNum': totle})
    # "try_extend[added_task][]":[4,8,16,32,64,128],
    if source in (1, 2):
        post_data.update({'try_extend[added_task][]': [4, 8, 16, 32, 64, 128]})
    elif source in (5, 12, 15):
        post_data.update({'try_extend[added_task][]': [8, 16, 32, 64, 128]})
    elif source == 13:
        post_data.update({'try_extend[added_task][]': [8, 16, 64, 128]})
    elif source == 8:
        post_data.update({'try_extend[added_task][]': [8, 16, 32, 128]})
    elif source == 14:
        post_data.update({'try_extend[added_task][]': [8, 16, 32, 64]})
    return url, post_data, header


def modshow_release(**kwargs):
    """
    模特秀发布活动数据
    :param kwargs:
    :return:
    """
    url = yaml_data.get_data('modshow_release_jp')['url']
    if kwargs.get('type') == 24:
        post_data = yaml_data.get_data('modshow_release_jp')['data']
    elif kwargs.get('type') == 25:
        post_data = yaml_data.get_data('modshow_release_sp')['data']
    header = yaml_data.get_data('modshow_release_jp')['header']
    token = kwargs.get('token')
    source = kwargs.get('source')
    shopId = kwargs.get('shopId')
    shop_name = kwargs.get('shop_name')
    Title = kwargs.get('Title')
    url_order = kwargs.get('url_order')
    title_pic = kwargs.get('title_pic')
    reference_imgs_0 = kwargs.get('reference_imgs_0')
    reference_imgs_1 = kwargs.get('reference_imgs_1')
    post_data.update({'trysType': kwargs.get('type')})
    post_data.update({'title': Title})
    post_data.update({'img_list': title_pic})
    post_data.update({'reference_imgs[0][imgs][]': reference_imgs_0})
    post_data.update({'reference_imgs[2][imgs][]': reference_imgs_1})
    post_data.update({'trySource': source})
    post_data.update({'token': token})
    post_data.update({'shop_id': shopId})
    post_data.update({'shop_name': shop_name})
    post_data.update({'url_order': url_order})
    return url, post_data, header

